﻿using Mbs.Configuration;
using Mbs.ComponentModel.Container;

namespace Mbs.Modularity
{
    [Component(Service = typeof(IModuleMetaRepository))]
    public class ConfigurationModuleMetaRepository : ModuleMetaRepository
    {
        public const string SectionName = "ModuleEnumerator";

        public override void Init()
        {
            ModuleElementCollection items = ModuleSection.GetInstance().Items;
            foreach (ModuleElement item in items)
                _modules.Add(ModuleProvider.CreateModuleMeta(item.AssemblyFile));
        }
    }
}